package com.fairytask.extention.scene;

import com.fairytask.extention.LoginExtention;
import com.fairytask.extention.define.CustomToClientDefine;
import com.fairytask.extention.define.SceneDefine;
import com.smartfoxserver.v2.api.ISFSApi;
import com.smartfoxserver.v2.entities.User;
import com.smartfoxserver.v2.entities.data.SFSObject;
import com.smartfoxserver.v2.extensions.SFSExtension;

/**
 * 扩展的场景管理
 * @author game
 */
public class SceneManager
{
	private LoginExtention	loginExt;
	private User	user;
	private ISFSApi api;
	public SceneManager(User puser,ISFSApi pApi,SFSExtension sfsExtension)
	{
		user	=	puser;
		api	=	pApi;
		loginExt	=	(LoginExtention)sfsExtension;
	}

	/**
	 * 场景切换
	 * @param pType
	 */
	public void switchScene(String pType)
	{
		SFSObject	sendObj	=	new SFSObject();
		sendObj.putUtfString(SceneDefine.TYPE, pType);
		
		//取得玩家信息
		
		loginExt.send(CustomToClientDefine.SCENE_SWITCH, sendObj, user);
	}

}
